class MyTab{
    constructor (seletor,options){
        this.ele = document.querySelector(seletor);
        this.btns = this.ele.querySelectorAll('ul > li');
        this.boxs = this.ele.querySelectorAll('ol > li');
        this.type = options || {}

        this.init();
    }

    init(){
            for(let i=0;i<this.btns.length;i++){
                this.btns[i].addEventListener(this.type.type||'click',()=>{
                    for(let j=0;j<this.btns.length;j++){
                        this.btns[j].classList.remove('active');
                        this.boxs[j].classList.remove('active');
                    }

                    this.btns[i].classList.add('active');
                    this.boxs[i].classList.add('active');


                    })
                }
            }
}
